Skip to content

fix(update): reload LaunchAgent after app activation - #313

Draft
munezaclovis wants to merge 3 commits into
mainfrom
agent/fix-launchagent-reload-update
Draft

fix(update): reload LaunchAgent after app activation#313
munezaclovis wants to merge 3 commits into
mainfrom
agent/fix-launchagent-reload-update

Conversation

@munezaclovis

Copy link
Copy Markdown
Contributor

What changed

  • Define LaunchAgent re-registration as part of every actual PV app activation.
  • Keep the validated PV-owned plist path from update preflight.
  • After activating a new release, perform tolerant bootout, bootstrap, then kickstart.
  • Repeat the same reload sequence after restoring the previous release during rollback.
  • Preserve app-current behavior: stale owned plist content may be normalized, but no daemon reload occurs.
  • Cover the launchd “already unloaded” response while still requiring bootstrap and kickstart.

Why

A current plist previously produced NotRequired, so PV only kickstarted the existing launchd registration after switching ~/.pv/bin/pv. launchd could therefore continue using the executable resolved from the previous registration. Rollback had the same issue.

Reloading the validated owned plist after every actual binary switch makes launchd resolve the active symlink again. The existing tolerant bootout handling preserves the already-unloaded case.

Review commits

  1. docs(design): require LaunchAgent reload after activation
  2. fix(cli): reload LaunchAgent after app activation
  3. test(cli): cover unloaded LaunchAgent update

Checks

  • cargo fmt --all -- --check
  • cargo clippy --workspace --all-targets --all-features --locked -- -D warnings
  • cargo nextest run -p cli --test update (38 passed)

Closes #300

@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: ba28d7d7-392a-4641-aa42-bee6bd15707d

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codspeed-hq

codspeed-hq Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 7 untouched benchmarks


Comparing agent/fix-launchagent-reload-update (188d54a) with main (058373c)

Open in CodSpeed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pv update incurs a 10-second launchd throttle after switching app binary

1 participant